package com.example;

import java.io.File;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: fransvanderlek
 * Date: 6/17/12
 * Time: 11:13 AM
 * To change this template use File | Settings | File Templates.
 */
public class MessageBarTextBuilder {

    private List<File> pendingFiles;

    public MessageBarTextBuilder(List<File> pendingFiles) {
        this.pendingFiles = pendingFiles;
    }

    public String buildText(){

        long sizeBytes = 0;

        for ( File file : pendingFiles)
        {
            sizeBytes+= file.length();
        }

        String sizeInfo = new FileSizeFormatter().format(sizeBytes);

        String fileListInfo = pendingFiles.size() + " files pending. Total size " + sizeInfo;

        return  fileListInfo;
    }
}
